cmake_minimum_required(VERSION 3.30)
include(pico_sdk_import.cmake)
project(p_relay C CXX ASM)
pico_sdk_init()

set(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
message(STATUS "Current dir is: ${CMAKE_CURRENT_SOURCE_DIR}")

# 添加头文件
include_directories(${PROJECT_ROOT_DIR}/inc)
include_directories(${PROJECT_ROOT_DIR}/inc/app)
include_directories(${PROJECT_ROOT_DIR}/inc/base)
include_directories(${PROJECT_ROOT_DIR}/inc/server)

add_executable(p_relay
    src/main.c

    src/base/common/common.c
    src/base/data_center/data_center.c
    src/base/list/list.c
    src/base/memory/memory.c
    src/base/srt/srt.c
    src/base/ssd1315/ssd1315.c

    src/server/i2c_server.c
    src/server/log_server.c
    src/server/shell_cmd_list.c
    src/server/uart_server.c

    src/app/ad.c
    src/app/ctrl.c
    src/app/screen.c
    src/app/ver.c
)

# pull in common dependencies
target_link_libraries(p_relay pico_stdlib pico_multicore hardware_i2c)

# create map/bin/hex file etc.
pico_add_extra_outputs(p_relay)
